#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int n, m;
long long f[N];
int main()
{
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
    {
        long long x;
        cin >> x;
        f[i] += x;
        f[i + 1] -= x;
    }
    int l, r, k;
    while (m--)
    {
        cin >> l >> r >> k;
        f[l] += k;
        f[r + 1] -= k;
    }
    for (int i = 1; i <= n; i++)
    {
        f[i] = f[i - 1] + f[i];
        cout << f[i] << ' ';
    }
    return 0;
}